package com.study.demo.aop.anno;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * aop代理
 * 注解方式
 * @author: elvin
 * @time: 2019-08-05 15:55
 * @desc:
 **/
public class Start {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext ap = new AnnotationConfigApplicationContext(AopConfig.class);

        Calculator calculator = ap.getBean(Calculator.class);

        calculator.divide(1, 1);

        System.out.println("-----------------------------------");

        calculator.divide(1, 0);

        ap.close();
    }
}
